//#define MONGODB
using Rafy;
using Rafy.ComponentModel;
using Rafy.Domain;
using Rafy.Domain.ORM;
using Rafy.Domain.Validation;
using Rafy.ManagedProperty;
using Rafy.MetaModel;
using Rafy.MetaModel.Attributes;
using Rafy.MongoDb;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Text;

namespace Rafy.Book
{
    public abstract class BookEntity : IntEntity { }



    public abstract class BookEntityRepository : EntityRepository
    {
        protected BookEntityRepository() { }
    }
#if MONGODB
    public abstract class BookEntityList<TEntity> : InheritableEntityList { }

    [DataProviderFor(typeof(BookEntityRepository))]
    public class BookEntityRepositoryDataProvider : MongoDbDataProvider
    {
        protected override string ConnectionStringSettingName
        {
            get { return BookPlugin.DbSettingName; }
        }

        public BookEntityRepositoryDataProvider()
        {
            this.EnumSerializationMode = Rafy.Domain.Serialization.Json.EnumSerializationMode.String;
        }
    }
#else
    public abstract class BookEntityList<TEntity> : EntityList<TEntity> where TEntity : Entity { }

    [DataProviderFor(typeof(BookEntityRepository))]
    public class BookEntityRepositoryDataProvider : RdbDataProvider
    {
        protected override string ConnectionStringSettingName
        {
            get { return BookPlugin.DbSettingName; }
        }
    }

#endif

    public abstract class BookEntityConfig<TEntity> : EntityConfig<TEntity> { }
}